package com.dxk.config;

import com.dxk.pojo.UserDemo;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;


@Configuration
public class configDemo {


    @Bean
    @ConfigurationProperties("user")
    public UserDemo getUserDemo(){
        UserDemo userDemo = new UserDemo();
        List<String> list = new ArrayList<String>();
        list.add("code");
        list.add("master");
        userDemo.setHobby(list
        );
        userDemo.setName("dxk");
        userDemo.setAge(99);
        return  userDemo;
    }

}
